import 'package:flutter/cupertino.dart';
import 'package:get/get.dart';
import '../../services/address.dart';
import '../../services/dio_manager.dart';
import 'home_model.dart';

class HomeController extends GetxController{


  AppGridModel? model;

  @override
  void onInit() {
    super.onInit();
    requestData();
  }

  /// 下拉刷新
   homePull()async{

     FocusScope.of(Get.overlayContext!).requestFocus(FocusNode());// 触摸收起键盘
     // requestData();
     requestData();

     update();
  }

  /// 获取我的全部
   void requestData({var search})async{

    var params  = {
      'search':search,
      'page':'1',
      'limit':'100',
    };

    var json = await DioManager().kkRequest(Address.appGridIndex,params: params,method: 'get');

    AppGridModel model1 = AppGridModel.fromJson(json);

    model = model1;

    // print('home_view Init${model!.data!.length}');

    update();

  }


  /// 模块跳转


}